﻿
using OABLL;
using OAModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MyOA
{
    public partial class zcsq : Form
    {
        qingjiabll bll = new qingjiabll();
        public string _yuangongid = string.Empty;
        public string _Oa请假单号 = string.Empty;
        public zcsq(string Oa请假单号,string oa)
        {   
            InitializeComponent();
           this. _yuangongid = oa;
            this._Oa请假单号 = Oa请假单号;
        }

        private void zcsq_Load(object sender, EventArgs e)
        {
            OAUseEntity user = new OAUseBLL().Getyuangong(_yuangongid);
            this.lbl员工id.Text = user.Oa员工id;
            this.lblxm.Text = user.Oa姓名;
        }

        private void btn请假提交_Click(object sender, EventArgs e)
        {

            QijiaEntity qj = new QijiaEntity();



            qj.Oa员工id = lbl员工id.Text;
            qj.Oa员工姓名=lbl姓名.Text;
            qj.Oa请假时间 = DateTime.Parse(dt请假时间.Value.ToString());
            qj.Oa请假时长 = tx请假时长.Text.Trim();
            qj.Oa请假理由 = textBox1.Text.Trim();

            bool b1 = bll.upqingjia(_Oa请假单号, qj);
            if (b1 == true)
            {
                MessageBox.Show("提交申请成功，等待审批中！");

            }
            else
            {
                MessageBox.Show("提交失败，请稍后重试！");
            }


        }
    }
}
